Skip to content

refactor: remove deprecated result types and compat shims#157

Open
jsonbailey wants to merge 1 commit intomainfrom
jb/aic-2388/remove-deprecated-types
Open

refactor: remove deprecated result types and compat shims#157
jsonbailey wants to merge 1 commit intomainfrom
jb/aic-2388/remove-deprecated-types

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

@jsonbailey jsonbailey commented Apr 29, 2026

Removes the deprecated result types (ModelResponse, StructuredResponse, AgentResult) and associated compat shims now that all runner implementations have migrated to the Runner protocol.

Stacked on #150 (LangChain runner migration).

Changes

  • Remove ModelResponse, StructuredResponse, AgentResult from providers/types.py
  • Remove ModelRunner-related compat from managed_model.py and managed_agent.py
  • Simplify ai_provider.py and model_runner.py
  • Update exports and tests

🤖 Generated with Claude Code


Note

Medium Risk
Medium risk because this removes deprecated public types/exports and changes protocol return types (ModelRunner/AgentRunner) to RunnerResult, which can break downstream imports and provider implementations.

Overview
Removes the deprecated response/result dataclasses ModelResponse, StructuredResponse, and AgentResult and drops their re-exports from ldai/ldai.providers.

Unifies runner protocols around RunnerResult: AgentRunner.run() and ModelRunner.invoke_model() now return RunnerResult, and AIProvider no longer includes legacy invoke_model/invoke_structured_model shims; ManagedModel is updated to type the tracked run result as RunnerResult.

Reviewed by Cursor Bugbot for commit 87007b9. Bugbot is set up for automated code reviews on this repo. Configure here.

@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from 9c0003c to 1aa1069 Compare April 29, 2026 16:49
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from 4966c51 to 1b3a1ba Compare April 29, 2026 16:49
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from 1aa1069 to f811cf8 Compare April 29, 2026 17:13
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from 1b3a1ba to cd04edb Compare April 29, 2026 17:13
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from f811cf8 to e56ea8f Compare April 29, 2026 17:15
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from cd04edb to de96fcd Compare April 29, 2026 17:15
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from e56ea8f to 4e0b78d Compare April 29, 2026 17:18
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from de96fcd to 33bcaa7 Compare April 29, 2026 17:18
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from 4e0b78d to c1c2c8c Compare April 29, 2026 17:37
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from 33bcaa7 to bccb5bc Compare April 29, 2026 17:39
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from c1c2c8c to a233c2f Compare April 29, 2026 17:59
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from bccb5bc to c2d054f Compare April 29, 2026 17:59
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from a233c2f to a770b1f Compare April 29, 2026 21:07
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from c2d054f to c083c3d Compare April 29, 2026 21:08
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from a770b1f to 069c0ee Compare April 29, 2026 21:13
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from c083c3d to f0c6494 Compare April 29, 2026 21:14
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from 069c0ee to 1c0255f Compare April 29, 2026 21:56
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from f0c6494 to 769815c Compare April 29, 2026 21:56
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from 1c0255f to 0355872 Compare April 30, 2026 14:01
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from 769815c to 19e344d Compare April 30, 2026 14:09
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from 0355872 to 796bda5 Compare April 30, 2026 14:21
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from 19e344d to 0374773 Compare April 30, 2026 14:26
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch from 796bda5 to a2db8cb Compare April 30, 2026 14:44
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from 0374773 to 6677156 Compare April 30, 2026 14:45
@jsonbailey jsonbailey force-pushed the jb/aic-2388/langchain-runner-protocol branch 4 times, most recently from 7aae3e2 to 1e61d42 Compare May 1, 2026 21:28
Base automatically changed from jb/aic-2388/langchain-runner-protocol to main May 1, 2026 21:34
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from 6677156 to 3867b8f Compare May 1, 2026 22:17
@jsonbailey jsonbailey marked this pull request as ready for review May 1, 2026 22:22
@jsonbailey jsonbailey requested a review from a team as a code owner May 1, 2026 22:22
@jsonbailey jsonbailey force-pushed the jb/aic-2388/remove-deprecated-types branch from 3867b8f to 87007b9 Compare May 1, 2026 22:22
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 87007b9. Configure here.

:param messages: Array of LDMessage objects representing the conversation
:return: ModelResponse containing the model's response and metrics
"""
...
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ModelRunner protocol is dead code after migration

Low Severity

The ModelRunner protocol defines invoke_model but nothing in the codebase calls this method or type-checks against this protocol. Both OpenAIModelRunner and LangChainModelRunner implement Runner (with its run method), not ModelRunner. The managed layer exclusively uses Runner. Implementing ModelRunner alone would not satisfy the Runner protocol the SDK requires, making this export misleading and effectively dead code that outlived its purpose during the migration.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 87007b9. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant